25. Edit Text Preference

Edit Text Preference

INSTRUCTOR NOTE:

EditTextPreference is a preference that allows for string input. Documentation is here

If you want to skip ahead and try to add this EditTextPreference yourself, go ahead and download this project and follow the TODOs in the comments.

There is a bug in the video ( @1'35" ),else if statement should be placed at an outer level. The correct code looks like:

if ( Preference instanceof ListPreference ) {
  if ( prefIndex >= 0 ) { }
} else if ( Preference instanceof EditTextPreference ) {
}